package com.rainng.coursesystem.dao.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.rainng.coursesystem.model.shitong.*;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public interface DeviceMapper {

    IPage<Object> queryDevice(@Param("po") DeviceVo po, Page<Object> pageParam);

    int countDevice(@Param("po") DeviceVo po);

    int saveDevice(@Param("po") DeviceSaveVo vo);

    int deleteDevice(String id);

    int updateDevice(String id,@Param("po") DeviceSaveVo vo);

    int updateStateDevice(String id, @Param("po") DeviceStateUpdateVo vo);

    int updateValidTimeDevice(String id, @Param("po") DeviceValidTimeUpdateVo vo);

    List<Integer> selectDeviceIdsByInUse();

    //使用主键查询
    String selectValidEndTimeById(Integer id);

    String selectStateById(Integer id);

    String selectDeviceNoById(Integer id);

    String selectStarttimeById(Integer id);

    String selectEndtimeById(Integer id);

    List<Map<String,Object>> selectDeviceById(Integer id);

    int saveDeviceLog(String user,String deviceNo,String message,String ctime);

    int saveDeviceValidTimeLog(String user,String deviceNo,String starttimeMessage,String endtimeMessage,String ctime);


    IPage<Object> queryDeviceLogs(@Param("po") DeviceLogsVo po, Page<Object> pageParam);

    int countDeviceLogs(@Param("po") DeviceLogsVo po);

    IPage<Object> queryDeviceTimeLogs(@Param("po") DeviceLogsVo po, Page<Object> pageParam);

    int countDeviceTimeLogs(@Param("po") DeviceLogsVo po);
    List<DeviceVo> deviceQueryByParams(@Param("prjNames") List<String> prjNames, @Param("measureRequirements") List<String> measureRequirement);
}
